-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a module for the latest SPIP vuln #17711
Conversation
Worked on this one as a rubber-ducky-debugger, for what it's worth, this exploit is quite minimal (which is perfect to lower the number of bugs) and gets the job done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jvoisin, thanks so much for the awesome contribution. I've made a couple minor suggestions.
Mainly I think this would be a great opportunity to make use of the command stager functionality in metasploit. This gives the user the option to either run a unix command when exploiting the module or return a meterpreter session. More on the command stager can be read about here: https://docs.metasploit.com/docs/development/developing-modules/guides/how-to-use-command-stagers.html.
Let me know if you have any questions at all regarding command stagers, I'd be happy to help in any way I could.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jvoisin, thanks for making those changes. I've made a couple more suggestions which fix the linting issue and standardizes the execute_command
method. I was hoping they would also fix the module but I couldn't seem to get it working.
Could you please:
- Retest the module
- Update the Scenarios section of the documentation.
I'm not sure what preventing the shell from returning, hard to say with the link to PoC still returning a 502. Thank you!
Thanks for making all those changes @jvoisin! Testing looked great, I've squashed and merged 🚀
|
Release NotesThis module exploits a PHP code injection in SPIP. The vulnerability exists in the oubli parameter and allows an unauthenticated user to execute arbitrary commands with web user privileges |
/!\ Please squash this PR before merging it. /!\
This module exploits a PHP code injection in SPIP. The vulnerability exists in
the
oubli
parameter and allows an unauthenticated user to execute arbitrarycommands with web user privileges. Branches 3.2, 4.0, 4.1 and 4.2 are
concerned. Vulnerable versions are <3.2.18, <4.0.10, <4.1.18 and <4.2.1.
Verification
List the steps needed to make sure this thing works
wget https://git.spip.net/spip-contrib-outils/checkout/src/branch/master/checkout.php
php checkout.php spip -b4.0.0 ./spip
cd ./spip
php -S 127.0.0.1:8080
msfconsole
use exploit/unix/webapp/spip_rce_form
set PAYLOAD php/exec
set CMD 'touch /tmp/pwn.txt
/tmp/pwn.txt
was created.Notes
It seems that the php payload is currently broken under PHP8, since it doesn't wrap its bas64-encoded payload between quotes, resulting in the following error:
This can be fixed by changing
return "eval(base64_decode(" + b64 + "));
toreturn "eval(base64_decode('" + b64 + "'));
inmodules/encoders/php/base64.rb
, and this is exactly what #17723 is doing.This vulnerability doesn't have a CVE.